
#ifndef __XB_RAM_H__
#define __XB_RAM_H__

/* ------------------------------------------------------------------------- */

#include <core.h>

/* ------------------------------------------------------------------------- */

#define RAM_BASE	0x00000000					/* physical zero */
#define RAM_FIX		0x04000000					/* 64 MB */
#define RAM_SIZE	0x08000000					/* 128 MB */
#define RAM_TOP		(RAM_BASE - 1 + RAM_SIZE)	/* 0x07ffffff */

#define ROM_BASE	0xff000000
#define ROM_FIX		0x00100000					/* 1 MB */
#define ROM_SIZE	0x01000000					/* 16 MB */
#define ROM_TOP		(ROM_BASE - 1 + ROM_SIZE)	/* 0xffffffff */

#define MCPX_BASE	0xfffffe00
#define MCPX_SIZE	0x00000200					/* 512 bytes */
#define MCPX_TOP	(MCPX_BASE - 1 + MCPX_SIZE)	/* 0xffffffff */

/* ------------------------------------------------------------------------- */

capi void fastcall ram_init(void);
capi uint32 fastcall ram_read(uint32 addr);
capi void fastcall ram_write(uint32 addr, uint32 data);

capi void fastcall rom_init(const void *image);
capi uint32 fastcall rom_read(uint32 addr);

capi void fastcall mcpx_init(const void *image);
capi uint32 fastcall mcpx_read(uint32 addr);

/* ------------------------------------------------------------------------- */

#endif
